package custom.pager
{
	import mx.collections.ArrayCollection;

	[Bindable]
	[RemoteClass(alias="com.gd360.jpa.dao.base.Page")]
	public class Page
	{
		// -- 分页参数 --//
		protected var _pageNo:int = 1;
		protected var _pageSize:int = 10;
		protected var _totalPn:int=0
		protected var _orderBy:String = null;
		protected var _order:String = null;
		protected var _autoCount:Boolean = true;
		//查询条件
		public var data:Object=new Object();
		// -- 返回结果 --//
		protected var _result:ArrayCollection = new ArrayCollection();
		protected var _totalCount:int = 0;
		public function Page()
		{
		}
		
		public function get pageNo():int
		{
			return _pageNo;
		}

		public function set pageNo(value:int):void
		{
			_pageNo = value;
		}

		public function get pageSize():int
		{
			return _pageSize;
		}

		public function set pageSize(value:int):void
		{
			_pageSize = value;
		}

		public function get orderBy():String
		{
			return _orderBy;
		}

		public function set orderBy(value:String):void
		{
			_orderBy = value;
		}

		public function get order():String
		{
			return _order;
		}

		public function set order(value:String):void
		{
			_order = value;
		}

		public function get autoCount():Boolean
		{
			return _autoCount;
		}

		public function set autoCount(value:Boolean):void
		{
			_autoCount = value;
		}

		public function get result():ArrayCollection
		{
			return _result;
		}

		public function set result(value:ArrayCollection):void
		{
			_result = value;
		}

		public function get totalCount():int
		{
			return _totalCount;
		}

		public function set totalCount(value:int):void
		{
			_totalCount = value;
		}

		public function get totalPn():int
		{
			if(_totalCount%_pageSize>0)
				return _totalCount/_pageSize + 1;
			return _totalCount/_pageSize;
		}

		public function set totalPn(value:int):void
		{
			_totalPn = value;
		}


	}
}